﻿using System;
using Super_Management_Mayhem.Content.Animations;
using Super_Management_Mayhem.Content.Animations.Manager;
using Super_Management_Mayhem.Content.Spritesheet.Player;
using Transformable_Engine_v2.Engine.Animation.ColorAnimation;
using Transformable_Engine_v2.Engine.Animation.FrameAnimation;
using Transformable_Engine_v2.Engine.Animation.PositionAnimation;
using Transformable_Engine_v2.Engine.Animation.Trajectory;
using Transformable_Engine_v2.Engine.Graphics;
using Transformable_Engine_v2.Engine.Time;
using Transformable_Engine_v2.Engine.Transformable_Math.Geometry;

namespace Super_Management_Mayhem.Screens.Playing.Players.Manager
{
    partial class Manager
    {
        private Timer _creationTimer;

        private void HandleKeyPressCreationState(Input input) {}

        private void HandleKeyReleaseCreationState(Input input) {}

        protected virtual void InitializeCreationState()
        {
            if (_creationTimer == null)
            {
                _creationTimer = new Timer(1400, false, () => ChangeState(PlayerState.Idle));
                AddTimers(_creationTimer);
            }

            _creationTimer.Start();

            _character.PositionGridBound = new TE_Vector2(0, -10);
            _character.Sprite = ManagerSheet.GetSprite(ManagerSheet.IdleState.Down);
            _character.OriginAbsolute = new TE_Vector2(8, 31);
            _character.Color = Color.Transparent;
            _character.AddAnimations(new FrameAnimation(new Spin(SpriteSheetPath)),
                                     new ColorAnimation(new LinearEasing(), Color.White, 500, false, 0),
                                     new PositionAnimation(new QuadraticEasing(BaseTrajectory.Easing.EaseIn), TE_Vector2.Zero, 1000, false, 0));
        }

        private void UpdateCreationState(TimeSpan gameTime) {}
    }
}
